<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title></title>
    <meta name="viewport" content="width=device-width, user-scalable=no, initial-scale=1.0, maximum-scale=1.0, minimum-scale=1.0">
    <script src="js/flexible.js"></script>
    <link rel="stylesheet" href="css/animate.css">
    <!-- <link rel="stylesheet" href="css/swiper.min.css"> -->
    <link rel="stylesheet" href="css/main.css">
</head>
<body >
    <div class="loading" style="display: none;">
      <div class="bar">
        <span class="line"></span>
      </div>
    </div>
    <div class="wrap game-wrap" style="display: block;">
          <div class="music on" id="music">
                <img src="images/play.png" alt="" class="play">
                <img src="images/pause.png" alt="" class="pause">
          </div>

        <!-- <img src="images/bg.jpg" class="bg-img" alt=""> -->

    </div>
  

  
<script src="js/jQuery.min.js"></script>
<audio src="js/game.mp3" id="game-music"></audio>
<script>
  $(function(){
          var $img = $('img');
            var length =$img.length;
            var oneWidth = 100 / length;
            var flag = 0;
           $('img').each(function(){
             var img = new Image();
             img.src = $(this).attr('src');
             img.onload = function(){
               flag++;
               $('.line').width(oneWidth * flag + '%');
               if(oneWidth * flag >= 90){
                $('.loading').hide();
                $('.wrap').show();
               }
             }
           }); 

     obj ={
      init:function(){
        this.num=null;
        this.prize=null;
        this.flag=true;//点击状态
        this.chance=1;//抽奖机会
        this.is_prize=false;//中奖状态，是否中奖，默认false
        this.bindEvent();
      },
      bindEvent:function(){
    
      }
                  
    }
    obj.init();

   //ios 音乐自动播放
      function audioAutoPlay(id){
        var audio = document.getElementById(id);
        audio.play();
        document.addEventListener("WeixinJSBridgeReady", function () {
            audio.play();
        }, false);
        document.addEventListener('YixinJSBridgeReady', function() {
            audio.play();
        }, false);
    }
        audioAutoPlay('game-music');
  });
</script>
</body>
</html>